package cn.xd.itstack.springframework.beans.common;

import cn.xd.itstack.springframework.beans.PropertyValue;
import cn.xd.itstack.springframework.beans.PropertyValues;
import cn.xd.itstack.springframework.beans.factory.ConfigurableListableBeanFactory;
import cn.xd.itstack.springframework.beans.factory.config.BeanDefinition;
import cn.xd.itstack.springframework.beans.factory.config.BeanFactoryPostProcessor;

/**
 * @Classname MyBeanFactoryPostProcessor
 * @Description TODO
 * @Date 2022/5/18 上午11:57
 * @Created by lvxiaodong
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        BeanDefinition userService = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = userService.getPropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("company","58同城"));
    }
}
